<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        /* onresize:浏览器窗口的尺寸发生变化的时候触发 */
        window.onresize=function(){
            // window.innerWidth  获取窗口的width
            console.log(window.innerWidth)
        }
        </script>
</body>
</html>